﻿<!DOCTYPE html>
<!-- 在线考试 详情-->
<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script src="/static/js/common.js"></script>

</head>

<body>

    <div id="app" v-cloak>
        <el-col span="24">
            <el-table ref="table" highlight-current-row @current-change="tableHandleCurrentChange"
                      :data="Form.zB_ExamRecord" :row-key="getRowKeys" :height="ListItem.tableHeight" border
                      @selection-change="handleSelectionChange" row-style="height:10px" style="width: 100%;">

                <!--时间-->
                <el-table-column prop="examinationstarttime" :label="'时间'" show-overflow-tooltip="true">
                </el-table-column>
                <!--类型-->
                <el-table-column prop="type" :label="'类型'" show-overflow-tooltip="true">
                </el-table-column>
                <!--答题分数-->
                <el-table-column prop="score" :label="'答题分数'" show-overflow-tooltip="true">
                </el-table-column>
                <!--正确数量-->
                <el-table-column prop="mark03" :label="'正确数量'" show-overflow-tooltip="true">
                </el-table-column>
                <!--错误数量-->
                <el-table-column prop="mark02" :label="'错误数量'" show-overflow-tooltip="true">
                </el-table-column>

            </el-table>
            <el-row>
                <el-table ref="table" :data="result.zB_ExamQuestions" :row-key="getRowKeys" :height="ListItem.tableHeight" border
                          row-style="height:10px" style="width: 100%;">
                    <!--考题名称-->
                    <el-table-column prop="questionContent" :label="'考题名称'" show-overflow-tooltip="true">
                    </el-table-column>
                    <!--正确答案-->
                    <el-table-column prop="rightkey" :label="'正确答案'" show-overflow-tooltip="true">
                    </el-table-column>
                    <!--我的选择-->
                    <el-table-column prop="firstOption" :label="'我的选择'">
                        <template scope="scope">
                            <span v-if="scope.row.firstOption == scope.row.rightkey" style="color:#37B328">{{ scope.row.firstOption }}</span>
                            <span v-else style="color: red">{{ scope.row.firstOption }}</span>
                        </template>
                    </el-table-column>

                </el-table>

            </el-row>

            <!--user建议替换为表名 需要与resource文件夹下js 中的对象保持一致  -->
        </el-col>
       
        <el-button type="primary" class="fr" @click="parent.ListItem.dialogVisible=false">{{col.btnBack}}</el-button>
    </div>
    <script type="text/javascript">

        var app = new Vue({

            el: '#app',
            data: {
                //父页传参
                result: {},
                id: '',
                checkList: ['选中且禁用', '复选框 A'],
                ListItem: ListItem,
                Trainingtype: [],
                Trainingobjectives: [],
                formInline: {
                    model: { hiddenTroubleClass: '', headOperations: '' },
                    offset: 0,
                    limit: 10
                },
                //业务表单内容
                Form: {
                    id: guidEmpty,
                    loginName: '',
                    name: '',
                    password: '',
                    sex: '',
                    remarks: '',
                },
                //表单验证
                rules: {
                    loginName: [
                        verification.NotNull,
                        { pattern: verification.StringLengthAtoB.t.format(2, 10), message: verification.StringLengthAtoB.m.format(5, 10), trigger: 'blur' }
                    ],
                    password: [
                        verification.NotNull

                    ],
                    sex: [
                        verification.NotNullSelect
                    ],
                    name: [
                        verification.NotNull
                    ]
                }
            },

            methods: {
                //获取分页数据
                GetPageData: function (currentIndex) { GetPageData(this, currentIndex, '/api/EducationExamination/GetList') },
                //查询方法
                onSubmit: function () { onSubmit(this); },
                btnUpLoad: function () {
                    this.$message({
                        message: '上传成功',
                        type: 'success'
                    });
                },
                //提交数据
                onSubmitForm: function (formName) {
                    var mythis = this;
                    this.$refs[formName].validate(function (valid) {
                        //验证通过
                        if (valid) {
                            onSubmitForm(this, '/api/EducationExamination/Save', mythis.Form);
                        } else {
                            //验证失败
                            return false;
                        }
                    });
                },
                getData: function () {
                    //当前id为ZB_ExamUser的id
                    //alert(this.id);
                    getData(this, '/api/ZB_ExamRecord/GetRecord?id=' + this.id);
                    console.log("xxxxxx",this.Form)
                },
                //Dialog展示
                UserInput: function (val, id) { DialogShow(this, val, "EducationExaminationInputPerson.html", id); },
                //删除方法
                onDelete: function () { onDelete(this, '/api/EducationExamination/DeleteMuti'); },
                //列表选择触发
                handleSelectionChange: function (val) { handleSelectionChange(this, val); },
                //获取分页数据
                GetPageData: function (currentIndex) { GetPageData(this, currentIndex, '/api/EducationExamination/GetList') },
                //pagesize改变 触发方法
                handleSizeChange: function (val) { handleSizeChange(this, val); },
                //跳页触发方法
                tableHandleCurrentChange: function (currentRow, a) {
                    this.currSeelctId = currentRow.id;
                    this.currSeelctCell = currentRow;

                    var mythis = this;
                    myAjax("get", mythis, '/api/ZB_ExamRecord/GetResult?id=' + currentRow.id, null, function (response) {
                        mythis.result = response.data;
                    }, false);
                    console.log("xxxxxx", this.result); 
                },
            },
            mounted: function () {
                //初始化数据

                //列表高度自适应
                // tablehigh(this);
                this.id = getUrlParam("id");

                this.getData();

            }
        });
    </script>
</body>

</html>